Various electronic devices rely on an oscillator to supply a clock signal, which is utilized by other components of the electronic device as is known in the art. Oscillators herein may be referred to as “external” or “internal.” External oscillators utilize an on-board crystal oscillator external to, for example, a processor or microcontroller that relies on the clock signal generated by the external oscillator. External oscillators are fairly accurate; however, they are more expensive from both a cost and board area perspective. In particular, many applications exist that require a reasonably accurate precision clock signal but do not need or cannot tolerate the cost of an external crystal oscillator.
Internal oscillators, such as a relaxation oscillator, are integrated to a processor or microcontroller, and rely on an energy-storing element such as a capacitor and a nonlinear switching device (e.g., a latch or a comparator) connected in a feedback loop. The switching device periodically charges and discharges the energy stored in the storage element, thus causing changes in the output waveform. Internal oscillators are typically cheap; unfortunately, internal oscillators are far less accurate. Typical sources of error are introduced by the comparator, which can have a variable delay and/or offset. Often, correcting for one of the delay or offset negatively impacts the other.